import axios from "axios";
import {retryAdapterEnhancer} from "./util"
// 默认配置
axios.defaults.timeout = 500;
axios.defaults.headers["Content-Type"] = "application/json;charset=UTF-8";
const request = axios.create({
  baseURL: "/api",
//   使用适配器配置全局重试次数和重试的延迟时间
  adapter: retryAdapterEnhancer(axios.defaults.adapter, {
    times:4,
    delay: 1000,
  }),
  maxRedirects: 0,
});
export { request };
